﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace RandomGenerator
{
    public partial class RandomGenerator : System.Web.UI.Page
    {
        Random rand;
        public RandomGenerator()
        {
            rand = new Random();
        }
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void submit_Click(object sender, EventArgs e)
        {
            int rangeBegin;
            int rangeEnd;
            int.TryParse(this.rangeBegin.Text, out rangeBegin);
            int.TryParse(this.rangeEnd.Text, out rangeEnd);
            
            int randNumber = this.rand.Next(rangeBegin, rangeEnd);
            this.resultPanel.Text = randNumber.ToString();
        }


    }
}